from get_douban import *
from get_douban import Douban_getter as Dg
import codecs

with open('test.txt') as f:
    line = f.readline()
    while ":" in line:
        name = line.split(":")[1].strip()
        if 'getter' not in locals():
            getter = Dg(name)
        else:
            getter.reini(name)
        getter.get_info()
        info_list = getter.get_with_format()
        with codecs.open('over.txt','a','utf-8',errors='ignore') as f1:
            print("writing",name)
            print(info_list)
            f1.write(info_list)
        line = f.readline()    
